﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace ExBlogger.Domain {
    public class BlogRegistrar {
        private static readonly BlogRegistrar _instance = new BlogRegistrar();

        public static BlogRegistrar GetInstance() { return _instance; }

        public User CreateUser(string username, string password) {
            if (String.IsNullOrWhiteSpace(username))
                throw new ArgumentException("username");
            if (String.IsNullOrWhiteSpace(password))
                throw new ArgumentException("password");

            User user = new User();
            user.Username = username;
            user.Password = String.Format("{0} not hashed", password); // HASH...
            user.IsApproved = true;
           
            return user;
        }
    }
}
